package com.wan.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 万星明
 * @Date 2019/2/12
 */
@Controller
public class TestController {

    //将配置中的端口注入,作为参数
    @Value("${server.port}")
    private int port;

    @RequestMapping("/test")
    @ResponseBody
    public String test(){
        System.out.println("服务提供01被调用,端口9091");
        return "页面返回:服务提供01被调用,端口:"+port;
    }



}
